package com.sc.nft.dao;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sc.nft.entity.vo.TicketRecordsVO;
import com.sc.nft.entity.vo.UserSalvageEventsRecordsVO;
import com.sc.nft.entity.vo.salvageEvents.AdminPageSalvageEventsRecordsVO;
import com.sc.nft.enums.NFTProductShowSalvagePrefectureEnum;
import lombok.extern.slf4j.Slf4j;
import com.sc.nft.entity.UserSalvageEventsRecords;
import com.sc.nft.mapper.UserSalvageEventsRecordsMapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Repository;

/**
 * 用户分解活动记录表(sc_user_salvage_events_records)数据DAO
 *
 * @author Sun
 * @since 2023-08-10 13:41:10
 * @description 由 Mybatisplus Code Generator 创建
 */
@Slf4j
@Repository
public class UserSalvageEventsRecordsDao extends ServiceImpl<UserSalvageEventsRecordsMapper, UserSalvageEventsRecords> {

    public Page<UserSalvageEventsRecordsVO> userSalvageEventsRecords(Long userId, Integer pageNo, Integer pageSize) {
        return baseMapper.userSalvageEventsRecords(new Page<>(pageNo, pageSize), userId);
    }

    public Page<AdminPageSalvageEventsRecordsVO> gtPageSalvageEventsRecords(String userTel,String eventsName, Integer pageNo, Integer pageSize) {
        return baseMapper.gtPageSalvageEventsRecords(new Page<>(pageNo, pageSize), userTel,eventsName);
    }

    public Integer getCountByUserIdAndEventsId(Long userId, Long id) {
        return baseMapper.getCountByUserIdAndEventsId(userId, id);
    }

    public Integer getSumCountById(Long id) {
        return baseMapper.getSumCountById(id);
    }

    public Page<TicketRecordsVO> getTicketRecords(Page page, Long userId) {
        return baseMapper.getTicketRecords(page,userId);
    }
}